
<div class="blogComments" id="proposalComments">

<div class="blogPages">
	<%= will_paginate @proposal_comments, :previous_label => "<< Precedenti", :next_label => "Successivi >>"%>
</div>
	
	<% @proposal_comments.each do |comment| %>
		<%= render :partial => 'proposals/comment', :locals => {:comment => comment} %>
	<% end %>

<div class="blogPages">
	<%= will_paginate @proposal_comments, :previous_label => "<< Precedenti", :next_label => "Successivi >>" %>
</div>	
	
</div>


<script>
$(document).ready(function() {		
    ajaxifyPagination();
});


function getParameterByName(path, name) {
  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regexS = "[\\?&]"+name+"=([^&#]*)";
  var regex = new RegExp(regexS);
  var results = regex.exec(path);
  if( results == null )
    return "";
  else
    return results[1];
}


function ajaxifyPagination() {
    $(".pagination a").click(function() {
		if (pageURL) {
			page = getParameterByName(this.href, 'page');
			my_pagination_url = pageURL + "?page=" + page;
		}
		else {
			my_pagination_url = $(this).attr("href");
		} 				
        $.ajax({
          type: "GET",
          url: my_pagination_url,
          dataType: "script"
        });
        return false;
    });
}
</script>